package com.lipaluma.annotations.merge;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import com.lipaluma.field.mapper.AutomaticFieldMapper;
import com.lipaluma.field.mapper.FieldMapper;

/**
 * Annotation allows user to put the value parsed in a Collection.<p>
 * 
 * This annotation will be very interesting in case of grouping rows and that the user want merge values in the collection
 * @author mario.soares
 */
@Documented
@Inherited
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface OneToMany {

	Class<? extends FieldMapper> with() default AutomaticFieldMapper.class;
	
	String path() default "";
	
	/**
	 * the path will be present on the result marshalled even if the value is empty
	 * @return
	 */
	boolean mandatoryPresence() default false;

}
